package com.cowin.sys.dao;

import com.cowin.base.Mapper;
import com.cowin.sys.model.TmBasUloc;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

public interface TmBasUlocMapper extends Mapper<TmBasUloc> {
    /**
     * 功能描述: 根据工位编号获取工位具体信息<br>
     *
     * @param ulocNo
     * @return:
     * @since: 1.0.0
     * @Author:yuchao
     * @Date: 2020/1/11 14:38
     */
    @Select("SELECT * FROM TM_BAS_ULOC where ULOC_NO=#{ulocNo}")
    TmBasUloc getUlocByUlocNo(String ulocNo);

    /**
     * 功能描述: <br>
     *  <10 20 30 点 返产线 工位NO>
     * @param:
     * @return:
     * @author:yuchao
     * @date: 2020/3/20 17:19
     */
    @Select("SELECT\n" +
            "\tTM_BAS_ULOC.TM_BAS_ULOC_ID ,TM_BAS_LINE.LINE_NO,TM_BAS_ULOC.ULOC_NO\n" +
            "FROM\n" +
            "\tTC_SYS_CODE_LIST\n" +
            "\tLEFT JOIN TM_BAS_ULOC ON TC_SYS_CODE_LIST.CODE_VALUE_DESC_E = TM_BAS_ULOC.ULOC_NO\n" +
            "\tleft join TM_BAS_LINE on TM_BAS_ULOC.TM_BAS_LINE_ID = TM_BAS_LINE.TM_BAS_LINE_ID\n" +
            "WHERE\n" +
            "\t TC_SYS_CODE_LIST.CODE_VALUE = #{codeValue}")
    Map<String,String> getLineUlocNoBycodeValue(@Param("codeValue") String codeValue);
}